package de.koller.worlders.engine.entity.mo.phsics;

import de.koller.oceanFramework.tree.Child;
import de.koller.worlders.engine.entity.mo.MovingObject;

public class PhysicsMO extends MovingObject {

	@Child private final MOMovingC2 momov = new MOMovingC2();
	private boolean overlapResolver = false;
	private float calcUntilDistance = 50;
	private float currentCalcDistance = 0;
	
	public PhysicsMO( float x, float y, float w, float h ) {
		super( x, y, w, h );
	}

	@Override
	protected void init() {
		super.init();
		
		wroot.getEntityContainer().getPhysics().getPmos().add( this );
	}

	@Override
	protected void release() {
		super.release();
		
		wroot.getEntityContainer().getPhysics().getPmos().remove( this );
	}

	public MOMovingC2 getMomov() {
		return momov;
	}

	public boolean isOverlapResolver() {
		return overlapResolver;
	}

	public void setOverlapResolver( boolean overlapResolver ) {
		this.overlapResolver = overlapResolver;
	}

	public void setCalcUntilDistance( float calcUntilDistance ) {
		this.calcUntilDistance = calcUntilDistance;
	}

	public float getCalcUntilDistance() {
		return calcUntilDistance;
	}

	public void setCurrentCalcDistance( float currentCalcDistance ) {
		this.currentCalcDistance = currentCalcDistance;
	}

	public boolean isCalcDistance() {
		return currentCalcDistance < calcUntilDistance;
	}
}
